<template>
<div>
        <strong>数据统计:</strong>
        <br><br>
        <List header="设备数据" footer="Footer" border>
            <ListItem>用户数量:{{statistics.userCount}}</ListItem>
            <ListItem>正常:{{statistics.userDevicesCount.normal}}台</ListItem>
            <ListItem>未激活:{{statistics.userDevicesCount.invalid}}台</ListItem>
            <ListItem>过期:{{statistics.userDevicesCount.expired}}台</ListItem>
        </List>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                statistics: null
            }
        },
        mounted(){
            this.getStatistics()
        },
        methods: {
            getStatistics(){
                this.$axios.get('/manager/index/statistics').then(res => {
                    if(res.status){
                        this.statistics = res.data
                    }else{
                        this.$Message.error(res.message);
                    }
                }).catch(error=>{
                    console.error(error)
                })
            }
        }
    }
</script>
